/**
 * Tunion.com Inc.
 * Copyright (c) 2004-2011 All Rights Reserved.
 */
package com.bieyang.anjia.module;

/**
 * 性别枚举
 * 
 * @author xingyu.shang
 * @version $Id: GenderEnum.java, v 0.1 2011-11-27 下午05:30:55 xingyu.shang Exp $
 */
public enum GenderEnum {
    /** 男 */
    M("M", "男"),
    /** 女 */
    F("F", "女");

    /** 枚举码. */
    private final String code;

    /** 描述信息. */
    private final String desc;

    /**
     * 构造函数
     * @param code
     * @param desp
     */
    private GenderEnum(String code, String desp) {
        this.code = code;
        this.desc = desp;
    }

    /**
     * Getter method for property <tt>code</tt>.
     * 
     * @return property value of code
     */
    public String getCode() {
        return code;
    }

    /**
     * Getter method for property <tt>desc</tt>.
     * 
     * @return property value of desc
     */
    public String getDesc() {
        return desc;
    }
    
    public static GenderEnum getStatus(String code) {
        for (GenderEnum status : GenderEnum.values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return null;
    }

}
